/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年8月2日 下午2:49:59
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.woniu.domain;

import java.util.Random;

/**
 * @author Administrator
 *
 */
public class Order {
	private int uId;
	private int oId;
	private String orderNum;
	private ShopCart shopCart;
	/**
	 * @return the uId
	 */
	public int getuId() {
		return uId;
	}
	/**
	 * @param uId the uId to set
	 */
	public void setuId(int uId) {
		this.uId = uId;
	}
	/**
	 * @return the oId
	 */
	public int getoId() {
		return oId;
	}
	/**
	 * @param oId the oId to set
	 */
	public void setoId(int oId) {
		this.oId = oId;
	}
	/**
	 * @return the orderNum
	 */
	public String getOrderNum() {
		Random random = new Random();
	    String result="";
	    for(int i=0;i<8;i++){
	        //首字母不能为0
	        result += (random.nextInt(9)+1);
	    }
	    return result;
	}
	
	/**
	 * @return the shopCart
	 */
	public ShopCart getShopCart() {
		return shopCart;
	}
	/**
	 * @param shopCart the shopCart to set
	 */
	public void setShopCart(ShopCart shopCart) {
		this.shopCart = shopCart;
	}
	@Override
	public String toString() {
		return "order [uId=" + uId + ", oId=" + oId + ", orderNum=" + orderNum + ", shopCart=" + shopCart + "]";
	}
	public Order(int uId, int oId, String orderNum, ShopCart shopCart) {
		super();
		this.uId = uId;
		this.oId = oId;
		this.orderNum = orderNum;
		this.shopCart = shopCart;
	}
	public Order() {
		super();
	}
	
}
